package com.zmj.sy.mom.srv.aps.mapper;

import com.zmj.sy.mom.srv.aps.bean.entity.base.PoolItem;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface PoolItemMapper extends SyMapper<PoolItem>{

    @Select("SELECT pi.construct_code FROM tb_mes_pool_item pi " +
            "  WHERE EXISTS (" +
            "    SELECT 1 FROM tb_mes_pool_item t WHERE t.construct_code = #{constructCode} AND t.pool_id = pi.pool_id AND t.deleted = 0 " +
            "  )")
    List<PoolItem> selectByConstructCode(@Param("constructCode") String constructCode);
}
